﻿<div class="blade-static __bottom" ng-include="'$(Platform)/Scripts/common/templates/create.tpl.html'" ng-if="blade.isNew"></div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block">
            <form name="formScope" class="form">
                <div ng-init="setForm(formScope)">
                    <label class="form-label" for="">{{ 'platform.blades.dynamicProperty-detail.labels.property-name' | translate }}</label>
                    <div class="form-input">
                        <input focus-on="" required ng-model="blade.currentEntity.name" placeholder="{{ 'platform.genericValueInput.placeholders.short-text' | translate}}" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="form-control __checkbox">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isRequired">
                            <span class="check"></span>
                            <span class="name">{{ 'platform.blades.dynamicProperty-detail.labels.required' | translate }}</span>
                        </label>
                    </div>
                    <div class="form-control __checkbox">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isArray" ui-validate=" 'arrayFlagValidator($value)' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="arrayFlag">
                            <span class="check"></span>
                            <span class="name">{{ 'platform.blades.dynamicProperty-detail.labels.multivalue' | translate }}</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.arrayFlag.$invalid">{{ 'platform.blades.dynamicProperty-detail.validations.multivalue' | translate }}</div>
                    <div class="form-control __checkbox" ng-class="{'__disabled': !blade.isNew}">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isMultilingual" ui-validate=" 'multilingualFlagValidator($value)' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="multilingualFlag">
                            <span class="check"></span>
                            <span class="name">{{ 'platform.blades.dynamicProperty-detail.labels.multilingual' | translate }}</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.multilingualFlag.$invalid">{{ 'platform.blades.dynamicProperty-detail.validations.multilingual' | translate }}</div>
                    <div class="form-control __checkbox" ng-class="{'__disabled': !blade.isNew}">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isDictionary" ui-validate=" '!$value || blade.currentEntity.valueType === \'ShortText\'' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="dictFlag">
                            <span class="check"></span>
                            <span class="name">{{ 'platform.blades.dynamicProperty-detail.labels.dictionary' | translate }}</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.dictFlag.$invalid">{{ 'platform.blades.dynamicProperty-detail.validations.dictionary' | translate }}</div>
                </div>
                <div class="form-group">
                    <label class="form-label" for="">{{ 'platform.blades.dynamicProperty-detail.labels.description' | translate }}</label>
                    <div class="form-input">
                        <input ng-model="blade.currentEntity.description" placeholder="{{ 'platform.blades.dynamicProperty-detail.placeholders.description' | translate}}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label" for="">{{ 'platform.blades.dynamicProperty-detail.labels.display-name' | translate }}</label>
                    <div class="form-input __langs" ng-repeat="data in blade.currentEntity.displayNames | orderBy: 'locale'">
                        <span class="flag flag-{{data.locale.substr(3).toLowerCase()}}"></span>
                        <input ng-model="data.name" placeholder="{{ 'platform.blades.dynamicProperty-detail.placeholders.display-name' | translate }}" />
                    </div>
                </div>
            </form>

            <ul class="list __items">
                <li class="list-item" ng-class="{'__selected': currentChild === 'valType', '__disabled': !blade.isNew}" ng-click='openChild("valType")'>
                    <span class="list-t">{{ 'platform.blades.dynamicProperty-detail.labels.value-type' | translate }}</span>
                    <span class="list-descr">{{blade.currentEntity.valueType | translate}}</span>
                </li>
                <li class="list-item" ng-class="{'__selected': currentChild === 'dict', '__disabled': !blade.currentEntity.isDictionary}" ng-click='openChild("dict")'>
                    <span class="list-t">{{ 'platform.blades.dynamicProperty-detail.labels.dictionary-values' | translate }}</span>
                    <span class="list-descr" ng-if="blade.currentEntity.isDictionary">{{ 'platform.blades.dynamicProperty-detail.labels.manage-dictionary' | translate }}</span>
                </li>
            </ul>
        </div>
    </div>
</div>